package com.lfs.market.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.lfs.market.model.entity.ProductInfo;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

public interface ProductInfoMapper extends BaseMapper<ProductInfo> {

    @Select("SELECT COUNT(*) FROM product_info WHERE DATE(create_time) = #{today}")
    Integer getTodayNewProductsCount(@Param("today") String today);

    @Select("SELECT COUNT(*) FROM product_info WHERE YEAR(create_time) = YEAR(CURDATE()) AND MONTH(create_time) = MONTH(CURDATE())")
    Integer getMonthNewProductsCount();
}
